package tech.aistar.mapper.order;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tech.aistar.entity.DemandOrder;

import java.util.List;

/**
 * Created by 23827 on 2019/9/27.
 */
public interface DemandOrderMapper {

//    查询所有的

    @Select("select * from demand_order")
    List<DemandOrder> findAll();

//    通过id查询
    @Select("select * from demand_order where id = #{value}")
    List<DemandOrder> getById(Integer id);


//    通过服务订单的订单编号进行查找

    @Select("select * from demand_order where order_number like concat('%',#{order_number},'%')")
    List<DemandOrder> find(String order_number);

//    删除
    @Update("update demand_order set status = 0 where id = #{value}")
    void delById(Integer id);

//    添加

    void insertDemandOrder(DemandOrder demandOrder);

//    更新
    void updateDemandOrder(DemandOrder demandOrder);





    //通过订单状态查询该条订单全部
    @Select("select * from demand_order where status = #{value}")
    List<DemandOrder> getByStstus(Integer status);






}
